package com.binance.notification.api.push.notification;

import com.binance.master.commons.ToString;
import com.binance.notification.api.push.INotification;
import com.binance.notification.api.push.PushCommand;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;

import org.springframework.validation.annotation.Validated;

/**
 * 单消息数据包
 *
 * @author louis
 * @date 2018-04-09 13:53:26
 */
@ApiModel(value = "单个推送通知数据包", description = "单个推送通知数据包")
public class SingleNotificationPacket<T extends INotification> extends ToString {

    private static final long serialVersionUID = 988729288837442336L;

    @ApiModelProperty(value = "推送控制命令", required = true)
    @NotNull
    private PushCommand command;

    @ApiModelProperty(value = "消息体", required = true)
    @NotNull
    private T message;

    @ApiModelProperty(hidden = true)
    private int sendno;

    @Validated
    public PushCommand getCommand() {
        return command;
    }

    public void setCommand(PushCommand command) {
        this.command = command;
    }

    @Validated
    public T getMessage() {
        return message;
    }

    public void setMessage(T message) {
        this.message = message;
    }

    public int getSendno() {
        return sendno;
    }

    public void setSendno(int sendno) {
        this.sendno = sendno;
    }

}
